﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace ChoMy.Helpers
{
    public class DateTimeHelper
    {
        public static bool IsBusinessDay(DateTime date)
        {
            return
                date.DayOfWeek != DayOfWeek.Saturday &&
                date.DayOfWeek != DayOfWeek.Sunday;
        }

        public static DateTime BusinessDaysTo(int days)
        {
            DateTime now = DateTime.Now;

            for (int i = 1; i <= days; i++)
            {
                if (!IsBusinessDay(now.AddDays(i)))
                {
                    days++;
                }
            }

            return now.AddDays(days);
        }
    }
}